<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #code {
            display: inline-block;
            width: 60px;
            line-height: 30px;
            text-align: center;
            background-color: #eee;
            letter-spacing: 2px;
            font-style: italic;
            font-weight: bold;
        }
    </style>
</head>
<body>

    <h2>表单验证</h2>
    <p>
        <label for="">请输入用户名</label>
        <input id="username" type="text" placeholder="用户名">
        <!-- <span>用户名是由数字，字母组成，且数字不能开头，长度必须是4-8位</span> -->
        <span id="userSpan">用户名错误</span>
    </p>
    <p>
        <label for="">请输入密码</label>
        <input id="password" type="password" placeholder="密码">
        <!-- <span>密码是由数字，字母组成长度必须是6-12位</span> -->
        <span id="pwdSpan">密码错误</span>
    </p>

    <p>
        <label for="">请输入手机号</label>
        <input type="text" placeholder="手机号">
        <!-- <span>手机号是11位</span> -->
        <span id="pwdSpan">手机号错误错误</span>
    </p>

    <p>
        <label for="">请输入验证码</label>
        <input id="codeInp" type="text">
        <span id="code">1234</span>
        <span id="codeSpan">验证码错误</span>
    </p>

    <button id="btn">提交</button>


    <script>
        
        

    </script>
    
</body>
</html>